#set(title='换书单',menu='exchlist',statusMap={'0':'待审核','1':'交易中','2':'待发货','3':'待买家确认收货','4':'交易完成','5':'交易关闭','6':'审核拒绝'})
#@index_layout()
#define index_main()
     <div class="table-responsive">
            <table class="table table-striped ">
              <thead>
                <tr>
                  <th>序号</th>
                  <th>图书</th>
                  <th>单价</th>
                  <th>数量</th>
                  <th>原价</th>
                  <th>状态</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
               #for(x : page.getList())
	             	<tr>
	                  <td>#(for.index+1)</td>
	                  <td>
	                  	<a href="#(ctx)/book/detail/#(x.bookId)"><img src="#(uploadPah)#(x.book.bookImg)" alt="book image" width="70px"></a>
	              				<a href="#(ctx)/book/detail/#(x.bookId)">#(x.book.name)</a>
	                  </td>
	                  <td>#(x.price)</td>
	                 <td>#(x.num)</td>
	                  <td>#(x.total)</td>
	                  <td>#(statusMap[x.status+''])</td>
	                  <td>
	                  	<button type="button" class="btn btn-info" id="buyExchBtn-#(x.trade.id)-#(x.num)" >我要换购此书</button>
	                  </td>
	                </tr>
                #end
              </tbody>
            </table>
          </div>
          
          <div class="modal fade buyBook-modal" tabindex="-1" role="dialog">
	  <div class="modal-dialog" role="document">
	    <div class="modal-content">
	      <div class="modal-header">
	        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	        <h4 class="modal-title">我要换购此书</h4>
	      </div>
	      <div class="modal-body">
	      	<form id="soldBookForm" class="form-horizontal" action="#(ctx)/order/sold" method="post">
				<div id="exchBookDiv">
				<table class="table">
					  <tr><td>
						  <label>
						    <input type="radio" name="orderItemId" id="optionsRadios1" value="option1">
						    	选择此书换购
						  </label>
						</td><td>书名</td><td> 价格</td><td>数量</td><td>原总价</td>
					</tr>
					<tr><td>
						  <label>
						    <input type="radio" name="orderItemId" id="optionsRadios1" value="option1">
						    	选择此书换购
						  </label>
						</td><td>书名</td><td> 价格</td><td>数量</td><td>原总价</td>
					</tr>
				</table>
				 </div>
				  
				  <div class="form-group">
				    <label class="col-sm-3 control-label">收货人姓名</label>
				    <div class="col-sm-8">
				    	<input type="text" class="form-control" name="name" id="name" value="">
				    </div>
				  </div>
				  <div class="form-group">
				    <label class="col-sm-3 control-label">收货人电话</label>
				    <div class="col-sm-8">
				    	<input type="text" class="form-control" name="mobile" id="mobile" value="">
				    </div>
				  </div>
				  <div class="form-group">
				    <label class="col-sm-3 control-label">收货人地址</label>
				    <div class="col-sm-8">
				    	<input type="text" class="form-control" name="address" id="address" value="">
				    </div>
				  </div>
				  
				  <input type="hidden" name="tradeId" id="tradeId" value="" />
				</form>
	      </div>
	      <div class="modal-footer">
	        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
	        <button type="button" class="btn btn-primary" id="exchBookBtn">确定换购</button>
	      </div>
	    </div><!-- /.modal-content -->
	  </div><!-- /.modal-dialog -->
	</div><!-- /.modal -->   
#end
